package com.jr.controller;

import com.jr.pojo.TopListAndBlogText;
import com.jr.service.TopListService;
import com.jr.util.ResultObject;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;


@RestController /*替换@RestController=@Controller + @ResponseBody*/
@RequestMapping("/Top/")
@SuppressWarnings("all")
public class TopListController {

    @Autowired
    private TopListService topListMapperService;
    @Autowired
    private ResultObject resultObject;

    @RequestMapping("showTop")
    public ArrayList<TopListAndBlogText> showTop(TopListAndBlogText topListAndBlogText) {
        resultObject.setStatus(400);
        ArrayList<TopListAndBlogText> list = topListMapperService.showTop(topListAndBlogText);
        return list;
    }
}
